{ -------------------- DEMO PROGRAM --------------------- }
program DELMSGBY; { A program to kill all FIDOnet messages by a
certain person }
{$M 16384,0,65536}
uses dos,fidomsg;
var foo :byte;
nametodel:string;
msg :FMsgType;
s :searchrec;
function upstr(st:string):string; { string processor that }
var a:string; { makes all uppercase and }
begin { removes spaces }
a:='';
for foo:=1 to length(st) do
begin
If st[foo]<>#32 then a:=a+upcase(st[foo]);
end;
upstr:=a;
end;
begin
if paramcount<1 then { If they don't know how to use this, then }
begin
writeln;
writeln(' Usage: DELMSGBY [firstname] [lastname]'); { Tell them }
writeln;
end
else { Otherwise, they DO know how to use this, so }
begin
nametodel:='';
for foo:=1 to paramcount do { Get the name they don't like} nametodel:=nametodel+' '+paramstr(foo);
findfirst('*.MSG',Anyfile,s); { And search all .MSG files for it} while (DosError=0) do { If a file is found then} begin
GetMsgHeap(msg); { Make space on the heap for it} loadmsg(msg,fexpand(s.name),foo); { Load it }
If (upstr(msg.FromUserName)=upstr(nametodel)) then
begin { If the message if from the bad guy} swapvectors; { then delete it. I used EXEC so} exec(getenv('COMSPEC'),' /C '+'Del '+fexpand(s.name)); { you can} swapvectors; { easily move, or rename it.} writeln('Deleting '+fexpand(s.name)+'. It''s Contaminated!');
end;
DisposeMsgHeap(msg); { Done w/ that message, so take back} findnext(s); { the heap space. Then find another} end; { Message to check. }
end;
end.
{ --------------------------- DEMO PROGRAM ----------------------------}
{this is a stand alone *.msg reader}
uses dos,crt;
Type FidoHeader=record {structure of the Message Header}
WhoTheMessageIsFrom,
WhoTheMessageItTo : Array[1..36] of Char; {ASCIIZ Strings}
MessageSubject : Array[1..72] of Char;
MessageDate : Array[1..20] of Char;
{The Message Date is an ASCIIZ string following this
format: DD MMM YY HH:MM:SS<Null>-20 Characters Total
Example: 01 Jun 94 20:00:00 is June 1st 1994 at 8:00PM
But SeaDog uses a slightly different version and you
might want to account for that, unfortunately I can't
remember the exact format, also SLMAIL for SearchLight
BBS only puts one space between the year and the hour
even though it's supposed to be 2, I'm surprised this
hasn't thrown mailers of other BBS programs}
TimesTheMessageWasRead,
DestinationNode,
OriginalNode,
CostofTheMessage,
OriginalNet,
DestinationNet : Integer;
{Note: TimesTheMessageWasRead & CostofTheMessage are
usually ignored when being exported from the BBS and can
be ignored when importing into a BBS}
DateWritten,
DateArrived : LongInt;
{I'm not sure how the dates are stored in here, but
they're usually ignored}
MessageToWhichThisRepliesTo: Integer;{Irrevelant over a network}
Arrtibutes : Word;
{Bit Field:
Bit 0 Private Message
1 Crashmail
2 Message Was Read
3 Message Was Sent
4 File Attatched, Filename in subject
5 Forwarded Message
6 Orphan Message ???
7 Kill After Its Sent (I think)
8 Message Originated Here (local)
9 Hold
10 Reserved
11 File Request, Filenames in Subject
12 Return Receipt Requested
13 This message is a Return Receipt
14 Audit Trail Requested
15 Update Request }
UnReply : Integer; {I have No Idea}
End;
Type FidoMsg=record
msgchar : char;
end;
{The Message Text follows terminated by either a Null (#0) or to Cr's #13#13.
Also all paragraphs are supposed to end with a Hard CR (#141) and you can
ignoreany #13 and reformat the text for your own program, also any lines
starting with^A (#1) should not be imported into the BBS, they are control
lines... thecontents of these lines varies so you'll have to find out that on